import React from 'react'
import { HashRouter, Route, Switch } from 'react-router-dom'
import Home from '../pages/Home'
import User from '../pages/User'
import Life from '../pages/Life'
import Shop from '../pages/Shop'
import BottomNav from '../components/BottomNav'
import Electricity from '../pages/Electricity'
import Broadband from '../pages/Broadband'
import LifeMore from '../pages/LifeMore'
import LayOut from '../pages/LayOut'
import City from '../pages/City'
import Search from "../pages/Search"
import Details from "../pages/Details"
import Login from "../pages/Login"
import Order from "../pages/Order"

export default function MyRouter () {
  return (
    <HashRouter>
      <Switch>
        <Route path="/electricity" component={Electricity}></Route>
        <Route path="/broadband" component={Broadband}></Route>
        <Route path="/lifeMore" component={LifeMore}></Route>
        <Route path="/city" component={City}></Route>
        <Route path="/search/:keywords" component={Search}></Route>
        <Route path="/details/:id" component={Details}></Route>
        <Route path="/login" component={Login}></Route>
        <Route path="/order" component={Order}></Route>
        <LayOut>
          <BottomNav />
          <Switch>
            <Route path="/" exact component={Home}></Route>
            <Route path="/user" component={User}></Route>
            <Route path="/life" component={Life}></Route>
            <Route path="/shop" component={Shop}></Route>
          </Switch>
        </LayOut>
      </Switch>
    </HashRouter>
  )
}
